package com.xiaoshu.controller;

import com.xiaoshu.model.ResultCode;
import com.xiaoshu.model.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 功能说明： Feign接口声明
 *
 * @ com.xiaoshu
 * <p>
 * Original @Author: deane.jia-贾亮亮,@2020/9/25@9:14
 * <p>
 * Copyright (C)2012-@2020 深圳小树盛凯科技 All rights reserved.
 */
@RestController
@RequestMapping(value = "/feign")
@Slf4j
@Api(value = "测试Feign")
public class FeignServiceController {

    @GetMapping(value = "/name", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "Feign接口测试")
    public ResultVo<String> getFeignName(@ApiParam(value = "name") @RequestParam(value = "name") String name) {
        log.info("start query the name :{}", name);
        return new ResultVo<>(ResultCode.SUCCESS, "[hi Feign] " + name);
    }
}
